<!DOCTYPE html>
<html lang="en">

<head>
    umnu8  
    <meta ch9arset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue全家桶_stu/03_依赖包/vue.js"></script>
    <style>
        #root {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }
    </style>
</head>

<body>
    <div id="root"><!-- span标签和a标签相互切换 -->
        <!-- 点击span标签切换到input标签 -->
        <span v-show="flag" @click="check">{{mes}}</span>
        <!-- input失焦和按下enter切换到span标签 --> 
        <input type="text" v-model="mes" v-show="!flag"  @keydown.enter="check" @blur="check">
    </div>
    <script>
        const vm = new Vue({
            el: '#root',
            data: {
                mes: '我爱你塞北的雪',
                flag: true
            },
            methods: {
                check() {
                    //修改标识状态
                    this.flag = !this.flag
                    // console.log(123)
                },
            }
        })
    </script>
</body>

</html>bd n m